<script setup lang="ts">
const props = defineProps<{
  money: number
  msg: string
  modelValue: number
}>()
// const emit = defineEmits(['ChangeMoney'])
const emit = defineEmits<{
  (e: 'update:money', money: number): void
  (e: 'update:msg', msg: string): void
}>()
// const change = () => {
//   emit('ChangeMoney', props.money)
// }
const ChangeMoney = () => {
  emit('update:money', props.money + 10)
}
const ChangeMsg = () => {
  emit('update:msg', 'hhhhh哈哈哈')
}
</script>

<template>
  <h3>子组件{{ money }} {{ msg }} {{ modelValue }}</h3>
  <!-- <button @click="$emit('ChangeMoney', money + 10)">修改数据</button> -->
  <button @click="ChangeMoney">修改数据</button>
  <button @click="ChangeMsg">修改数据2</button>
  <button @click="$emit('update:modelValue', 20)">修改数据3</button>
</template>

<style lang="scss" scoped></style>
